$("#add").on("click", function () {
    $.showPage("", "添加", webRoot + "/console/systemRoles/add.html");
});

var curEl = $("#systemRolesTable");
curEl.initTable({
    url: webRoot + '/console/systemRoles',
    columns: systemRoleColumns(),
    isPagination: true,
    buttons: [{
        id: "edit",
        btnClass: "btn btn-default btn-xs purple",
        icon: "fa fa-edit",
        name: "编辑",
        handler: function (row) {
            $.showPage("", "编辑", webRoot + "/console/systemRoles/edit.html?id=" + row.id);
        }
    }, {
        id: "editPermission",
        btnClass: "btn btn-default btn-xs purple",
        icon: "fa fa-edit",
        name: "编辑权限",
        hidden: function (row) {
            return !row.status
        },
        handler: function (row) {
            $.showPage("", "编辑权限", webRoot + "/console/systemRoles/editPermission.html?id=" + row.id);
        }
    }]
});